package com.assumejson.aop.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.aspectj.lang.annotation.Pointcut;
import org.springframework.stereotype.Component;

/**
 * @author gang.Li
 * @version 1.0
 * @since 1.0 2021/12/9 14:44
 */
@Aspect
@Component
public class MyAop {

	@Pointcut("execution(* com.assumejson.aop.service.UserService.*(..))")
	public void a() {
	}

	@Before("a()")
	public void test(JoinPoint joinPoint) {
		System.out.println("aop is running...");
	}

	@Around("a()")
	public void test1(JoinPoint joinPoint) {
		System.out.println("Around is running...");
	}

}
